//
//  DestinationNoticeViewController.m
//  HappyTrip
//
//  Created by yuxuesong on 15-3-24.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "DestinationNoticeViewController.h"

@interface DestinationNoticeViewController ()

@end

@implementation DestinationNoticeViewController

- (void)dealloc
{
    [_noticeSendType release];
    [_noticeSendId release];
    [super dealloc];
}

- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0 / 255.0 green:170.0 / 255.0 blue:205.0 / 255.0 alpha:1.0];
    self.tabBarController.tabBar.hidden = NO;
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, nil]];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor colorFromHexCode:@"#F5FFFA"];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"iconfont-fanhui.png"] style:UIBarButtonItemStylePlain target:self action:@selector(leftBarButtonItemAction:)];
    self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];
    
    UILabel *webLabel = [[UILabel alloc] initWithFrame:CGRectMake(0 , -44, VIEW_WIDTH, VIEW_HEIGHT + 44)];
    webLabel.userInteractionEnabled = YES;
    [self.view addSubview:webLabel];
    [webLabel release];
    
    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, VIEW_WIDTH, VIEW_HEIGHT + 44)];
    webView.scrollView.bounces = NO;
    NSString *urlStr = [NSString stringWithFormat:@"http://breadtrip.com/mobile/destination/%@/%@/overview/", self.noticeSendType, self.noticeSendId];
    NSURL *url = [NSURL URLWithString:urlStr];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [webLabel addSubview:webView];
    [webView loadRequest:request];
    [webView release];
    
}

- (void)leftBarButtonItemAction:(UIBarButtonItem *)button
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
